package main

import (
	"fmt"
	"gitee.com/dehow/k8sdev/router"
	"github.com/gin-gonic/gin"
)

func main() {
	gin.SetMode(gin.DebugMode)
	//if gin.Mode() == gin.DebugMode {
	//	go func() {
	//		log.Println(http.ListenAndServe("localhost:6060", nil))
	//	}()
	//}
	engine := gin.Default() // ==new() + logger + recovery
	//engine := gin.New() // ==new() + logger + recovery

	//routes
	router.LoadWebRootRoutes(engine)
	router.LoadPublicRoutes(engine)
	//fmt.Printf("%+v\n", engine.Routes())

	// 监听并在 0.0.0.0:8090 上启动服务
	err := engine.Run(":8090")
	if err != nil {
		fmt.Println(err)
		return
	}
}
